package com.bit.cfdi.web.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.bit.cfdi.web.dao.HistorialPasswordDAO;
import com.bit.cfdi.web.domain.HistorialPassword;
@Service
public class HistorialPasswordService {

	@Autowired HistorialPasswordDAO historialPasswordDAO;
	
	public void save(HistorialPassword historialPassword) throws DataAccessException {
		historialPasswordDAO.save(historialPassword);
	}

	public List<HistorialPassword> getFirstThreeRecords(String email) throws DataAccessException {
		return historialPasswordDAO.getFirstThreeRecords(email);
	}
	
	public void deleteMinIndex(HistorialPassword historialPassword) {
		historialPasswordDAO.deleteMinRecord(historialPassword);
	}
	
	public String existThisPassword(String password) {
		return historialPasswordDAO.existThisPassword(password);
	}
	
}
